package com.github.cosycode.web.base.post;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * <b>Description : </b>
 * <p>
 * <b>created in </b> 2022/1/27
 * </p>
 *
 * @author CPF
 * @since 1.0
 **/
public class PostCodeBeanPool {

    private static final Map<IPostCode, PostCodeBean> DICT_ITEM_MAP = new ConcurrentHashMap<>();

    private PostCodeBeanPool() {
    }

    public static void putBean(IPostCode iPostCode, String code, String msg, String desc) {
        DICT_ITEM_MAP.put(iPostCode, new PostCodeBean(code, msg, desc));
    }

    public static PostCodeBean getBean(IPostCode iPostCode) {
        return DICT_ITEM_MAP.get(iPostCode);
    }
}
